<style>
    .homePanel {
        width: 500px;
        height: 300px;
        border: 1px solid #ccc;
        /*  float: left;*/
        background: white;
        margin: 10px
    }

    .homePanel > div:first-child {
        background: #f3f3f3;
        padding: 5px;
    }

    .homePanel > div:last-child {
        padding: 2px;
        background: #fff;
    }

    .homePanel div p {
        margin-left: 10px;
    }

</style>
<script src="/static/echars/echarts.min.js"></script>
<div class="easyui-draggable easyui-resizable homePanel" style="float: left" data-options="handle:'#d1'">
    <div id="d1"></div>
    <div>
        <p>今日新增用户数：<span class="todayNewUser"></span></p>
        <p>今日登录用户数：<span class="todayLoginUser"></span></p>
        <p>历史总用户数：<span class="historyUser"></span></p>
        <p>当前在线用户数：<span class="onLineUser"></span></p>
    </div>
</div>
<div class="easyui-draggable easyui-resizable homePanel" style="float: left" data-options="handle:'#d2'">
    <div id="d2">借款管理</div>
    <div>
        <p>未处理的借款申请：<span class="wclLoanNum"></span></p>
        <p>待处理的个人借款意向：<span class="dclLoanNum"></span></p>
        <p>发标待初审：<span class="reviewTargetNum"></span></p>
        <p>发标待发布：<span class="publishTargetNum"></span></p>
        <p>满标待复审：<span class="fullTargetNum"></span></p>
        <p>逾期未还款：<span class="whk"></span></p>
    </div>
</div>
<div class="easyui-draggable easyui-resizable homePanel" style="float: left" data-options="handle:'#d3'">
    <div id="d3">个人信息</div>
    <div>
        <p>用户名：<span class="loginName"></span></p>
        <p>真实姓名：<span class="realName"></span></p>
        <p>部门：<span class="dept"></span></p>
        <p>状态：正常</p>
        <p>员工号：<span class="empNo"></span></p>
        <p>邮箱：<span class="email"></span></p>
        <p>手机号：<span class="telephone"></span></p>
        <p>职位：<span class="position"></span></p>
    </div>
</div>
<div class="easyui-draggable easyui-resizable homePanel" style="float: left" data-options="handle:'#d4'">
    <div id="d4">平台运营总数据</div>
    <div>
        <p>总投资金额：<span class="totalInvest"></span>元</p>
        <p>总回款金额：<span class="totalReturn"></span>元</p>
        <p>总用户数：<span class="totalUser"></span></p>
        <p>总借款标数量：<span class="totalTargetNum"></span></p>
    </div>
</div>
<div class="easyui-draggable easyui-resizable homePanel" style="float: left" data-options="handle:'#d5'">
    <div id="d5">昨日统计</div>
    <div>
        <p>昨日投资金额：<span class="yesInvest"></span>元</p>
        <p>昨日回款金额：<span class="yesReturn"></span>元</p>
        <p>昨日新增用户数：<span class="yesAddUser"></span></p>
        <p>昨日借款标数量：<span class="yesLoanTarget"></span></p>
    </div>
</div>
<div class="easyui-draggable easyui-resizable homePanel" style="float: left" data-options="handle:'#d6'">
    <div id="d6">上周统计</div>
    <div>
        <p>上周投资金额：<span class="lastWeekInvest"></span>元</p>
        <p>上周回款金额：<span class="lastWeekReturn"></span>元</p>
        <p>上周新增用户数：<span class="lastWeekAddUser"></span></p>
        <p>上周借款标数量：<span class="lastWeekLoanTarget"></span></p>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        restPosition();
        $.get("/home/list", function (msg) {
            if (msg.state == "SUCCESS") {
                setHtml(msg);
            } else {
                $.messager.show({
                    title: '操作提示',
                    msg: msg.message,
                    timeout: 2000,
                    showType: 'slide'
                });
            }
        })
    });
    function restPosition() {
        var point = [];
        $(".homePanel").each(function (i, v) {
            var top = $(this).position().top;
            var left = $(this).position().left;
            point[i] = {top: top, left: left};
        });
        $(".homePanel").each(function (i, v) {
            var top = point[i].top;
            var left = point[i].left;
            $(this).css("float", "none").css("position", "absolute").css("left", left + "px").css("top", top + "px");
        });
    }
    function setHtml(msg) {
        var data = msg.data;
        for (var name in data) {
            var val = data[name];
            if (val != null) {
                $("." + name).html(val);
            }
        }
    }

</script>